﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusLib
{
    public class BusUtils
    {
        public static DateTime ServiceDay(DateTime t)
        {
            TimeSpan FirstTrip = TimeSpan.FromHours(4); // 4 am
            if (t - t.Date < FirstTrip)
                return t.Date - TimeSpan.FromDays(1);
            else
                return t.Date;
        }
    }

}
